package resilienceManager.qmul.gemom;
import java.awt.Color;
import java.awt.Font;

import no.geosoft.cc.geometry.Geometry;
import no.geosoft.cc.graphics.GObject;
import no.geosoft.cc.graphics.GPosition;
import no.geosoft.cc.graphics.GSegment;
import no.geosoft.cc.graphics.GStyle;
import no.geosoft.cc.graphics.GText;

/**
 * the line object, used to draw the node in the scence 
 * 
 * COPYRIGHT DISCLAIMER
 * Synopsis: All the source codes presented in this document are intellectual
 * properties of Queen Mary, University of London.
 * 
 * @year 2010
 * @author Peng Jiang, John Bigham, Jiayi Wu Jinfu Wang------------QMUL
 * @version 1.0 
 */


public class gline extends GObject{
	
	private int         x_, y_;
    private int         length_;
    private GSegment    title_;
    private GSegment    line_end;
    
    
    
    
    
    gline(String t, GObject parent,int x, int y, int l)
    {
    	x_=x;
    	y_=y;
    	length_=l;
    	
    	
    	line_end = new GSegment();
    	
    	addSegment(line_end);
        
    	title_ = new GSegment();
        GStyle titleStyle = new GStyle();
        titleStyle.setForegroundColor (new Color (255, 255, 255));
        titleStyle.setBackgroundColor (new Color (0, 0, 255));
        titleStyle.setFont (new Font ("Dialog", Font.BOLD, 14));
        title_.setStyle (titleStyle);
        title_.setText (new GText (t));
        addSegment (title_);

        
        setStyle (new GStyle());
        
        parent.add(this);

    	
    }
    
    public void draw()
	{
	
    	title_.setGeometry (x_, y_);
		
		line_end.setGeometry (0, y_+10, length_, y_+10);
	}


}
